home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_h.lzh / intuition / screens.h < prev    next >
C/C++ Source or Header  |  1991-03-14  |  14KB  |  407 lines

  1. #ifndef INTUITION_SCREENS_H
  2. #define INTUITION_SCREENS_H TRUE
  3. /*
  4. **  $Filename: intuition/screens.h $
  5. **  $Release: 2.04 $
  6. **  $Revision: 36.35 $
  7. **  $Date: 91/02/12 $
  8. **
  9. **  The Screen and NewScreen structures and attributes
  10. **
  11. **  (C) Copyright 1985,1986,1987,1988,1989,1990 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include <exec/types.h>
  17. #endif
  18.  
  19. #ifndef GRAPHICS_GFX_H
  20. #include <graphics/gfx.h>
  21. #endif
  22.  
  23. #ifndef GRAPHICS_CLIP_H
  24. #include <graphics/clip.h>
  25. #endif
  26.  
  27. #ifndef GRAPHICS_VIEW_H
  28. #include <graphics/view.h>
  29. #endif
  30.  
  31. #ifndef GRAPHICS_RASTPORT_H
  32. #include <graphics/rastport.h>
  33. #endif
  34.  
  35. #ifndef GRAPHICS_LAYERS_H
  36. #include <graphics/layers.h>
  37. #endif
  38.  
  39. #ifndef UTILITY_TAGITEM_H
  40. #include <utility/tagitem.h>
  41. #endif
  42.  
  43. /*
  44.  * NOTE:  intuition/iobsolete.h is included at the END of this file!
  45.  */
  46.  
  47. /* ======================================================================== */
  48. /* === DrawInfo ========================================================= */
  49. /* ======================================================================== */
  50.  
  51. /* This is a packet of information for graphics rendering.  It originates
  52.  * with a Screen, and is gotten using GetScreenDrawInfo( screen );
  53.  */
  54.  
  55. /* If you find dri_Version >= DRI_VERSION, you know this structure
  56.  * has at least the fields defined in this version of the include file
  57.  */
  58. #define RI_VERSION    (1)    /* obsolete, will be removed        */
  59. #define DRI_VERSION    (1)
  60.  
  61. struct DrawInfo
  62. {
  63.     UWORD    dri_Version;    /* will be  DRI_VERSION            */
  64.     UWORD    dri_NumPens;    /* guaranteed to be >= numDrIPens    */
  65.     UWORD    *dri_Pens;    /* pointer to pen array            */
  66.  
  67.     struct TextFont    *dri_Font;    /* screen default font        */
  68.     UWORD    dri_Depth;    /* (initial) depth of screen bitmap    */
  69.  
  70.     struct {      /* from DisplayInfo database for initial display mode    */
  71.     UWORD    X;
  72.     UWORD    Y;
  73.     }        dri_Resolution;
  74.  
  75.     ULONG    dri_Flags;        /* defined below        */
  76.     ULONG    dri_Reserved[7];    /* avoid recompilation ;^)    */
  77. };
  78.  
  79. #define DRIF_NEWLOOK    0x00000001    /* specified SA_Pens, full treatment */
  80.  
  81. /* rendering pen number indexes into DrawInfo.dri_Pens[]    */
  82. #define DETAILPEN     (0x0000)    /* compatible Intuition rendering pens    */
  83. #define BLOCKPEN     (0x0001)    /* compatible Intuition rendering pens    */
  84. #define TEXTPEN         (0x0002)    /* text on background            */
  85. #define SHINEPEN     (0x0003)    /* bright edge on 3D objects        */
  86. #define SHADOWPEN     (0x0004)    /* dark edge on 3D objects        */
  87. #define FILLPEN         (0x0005)    /* active-window/selected-gadget fill    */
  88. #define FILLTEXTPEN     (0x0006)    /* text over FILLPEN            */
  89. #define BACKGROUNDPEN     (0x0007)    /* always color 0            */
  90. #define HIGHLIGHTTEXTPEN (0x0008)    /* special color text, on background    */
  91.  
  92. #define NUMDRIPENS     (0x0009)
  93.  
  94.  
  95. /* ======================================================================== */
  96. /* === Screen ============================================================= */
  97. /* ======================================================================== */
  98. struct Screen
  99. {
  100.     struct Screen *NextScreen;        /* linked list of screens */
  101.     struct Window *FirstWindow;        /* linked list Screen's Windows */
  102.  
  103.     WORD LeftEdge, TopEdge;        /* parameters of the screen */
  104.     WORD Width, Height;            /* parameters of the screen */
  105.  
  106.     WORD MouseY, MouseX;        /* position relative to upper-left */
  107.  
  108.     UWORD Flags;            /* see definitions below */
  109.  
  110.     UBYTE *Title;            /* null-terminated Title text */
  111.     UBYTE *DefaultTitle;        /* for Windows without ScreenTitle */
  112.  
  113.     /* Bar sizes for this Screen and all Window's in this Screen */
  114.     /* Note that BarHeight is one less than the actual menu bar
  115.      * height.    We're going to keep this in V36 for compatibility,
  116.      * although V36 artwork might use that extra pixel
  117.      *
  118.      * Also, the title bar height of a window is calculated from the
  119.      * screen's WBorTop field, plus the font height, plus one.
  120.      */
  121.     BYTE BarHeight, BarVBorder, BarHBorder, MenuVBorder, MenuHBorder;
  122.     BYTE WBorTop, WBorLeft, WBorRight, WBorBottom;
  123.  
  124.     struct TextAttr *Font;        /* this screen's default font       */
  125.  
  126.     /* the display data structures for this Screen */
  127.     struct ViewPort ViewPort;        /* describing the Screen's display */
  128.     struct RastPort RastPort;        /* describing Screen rendering       */
  129.     struct BitMap BitMap;        /* extra copy of RastPort BitMap   */
  130.     struct Layer_Info LayerInfo;    /* each screen gets a LayerInfo    */
  131.  
  132.     /* Only system gadgets may be attached to a screen.
  133.      *    You get the standard system Screen Gadgets automatically
  134.      */
  135.     struct Gadget *FirstGadget;
  136.  
  137.     UBYTE DetailPen, BlockPen;        /* for bar/border/gadget rendering */
  138.  
  139.     /* the following variable(s) are maintained by Intuition to support the
  140.      * DisplayBeep() color flashing technique
  141.      */
  142.     UWORD SaveColor0;
  143.  
  144.     /* This layer is for the Screen and Menu bars */
  145.     struct Layer *BarLayer;
  146.  
  147.     UBYTE *ExtData;
  148.  
  149.     UBYTE *UserData;    /* general-purpose pointer to User data extension */
  150.  
  151.     /**** Data below this point are SYSTEM PRIVATE ****/
  152. };
  153.  
  154.  
  155. /* --- FLAGS SET BY INTUITION --------------------------------------------- */
  156. /* The SCREENTYPE bits are reserved for describing various Screen types
  157.  * available under Intuition.
  158.  */
  159. #define SCREENTYPE    0x000F    /* all the screens types available    */
  160. /* --- the definitions for the Screen Type ------------------------------- */
  161. #define WBENCHSCREEN    0x0001    /* identifies the Workbench screen    */
  162. #define PUBLICSCREEN    0x0002    /* public shared (custom) screen    */
  163. #define CUSTOMSCREEN    0x000F    /* original custom screens        */
  164.  
  165. #define SHOWTITLE    0x0010    /* this gets set by a call to ShowTitle() */
  166.  
  167. #define BEEPING        0x0020    /* set when Screen is beeping (private)    */
  168.  
  169. #define CUSTOMBITMAP    0x0040    /* if you are supplying your own BitMap */
  170.  
  171. #define SCREENBEHIND    0x0080    /* if you want your screen to open behind
  172.                  * already open screens
  173.                  */
  174. #define SCREENQUIET    0x0100    /* if you do not want Intuition to render
  175.                  * into your screen (gadgets, title)
  176.                  */
  177. #define SCREENHIRES    0x0200    /* do not use lowres gadgets  (private)    */
  178.  
  179. #define NS_EXTENDED    0x1000        /* ExtNewScreen.Extension is valid    */
  180. /* V36 applications can use OpenScreenTagList() instead of NS_EXTENDED    */
  181.  
  182. #define AUTOSCROLL    0x4000    /* screen is to autoscoll        */
  183.  
  184. #define STDSCREENHEIGHT -1    /* supply in NewScreen.Height        */
  185. #define STDSCREENWIDTH -1    /* supply in NewScreen.Width        */
  186.  
  187. /*
  188.  * Screen attribute tag ID's.  These are used in the ti_Tag field of
  189.  * TagItem arrays passed to OpenScreenTagList() (or in the
  190.  * ExtNewScreen.Extension field).
  191.  */
  192.  
  193. /* Screen attribute tags.  Please use these versions, not those in
  194.  * iobsolete.h.
  195.  */
  196.  
  197. #define SA_Dummy    (TAG_USER + 32)
  198. /*
  199.  * these items specify items equivalent to fields in NewScreen
  200.  */
  201. #define SA_Left        (SA_Dummy + 0x0001)
  202. #define SA_Top        (SA_Dummy + 0x0002)
  203. #define SA_Width    (SA_Dummy + 0x0003)
  204. #define SA_Height    (SA_Dummy + 0x0004)
  205.             /* traditional screen positions    and dimensions    */
  206. #define SA_Depth    (SA_Dummy + 0x0005)
  207.             /* screen bitmap depth                */
  208. #define SA_DetailPen    (SA_Dummy + 0x0006)
  209.             /* serves as default for windows, too        */
  210. #define SA_BlockPen    (SA_Dummy + 0x0007)
  211. #define SA_Title    (SA_Dummy + 0x0008)
  212.             /* default screen title                */
  213. #define SA_Colors    (SA_Dummy + 0x0009)
  214.             /* ti_Data is an array of struct ColorSpec,
  215.              * terminated by ColorIndex = -1.  Specifies
  216.              * initial screen palette colors.
  217.              */
  218. #define SA_ErrorCode    (SA_Dummy + 0x000A)
  219.             /* ti_Data points to LONG error code (values below)*/
  220. #define SA_Font        (SA_Dummy + 0x000B)
  221.             /* equiv. to NewScreen.Font            */
  222. #define SA_SysFont    (SA_Dummy + 0x000C)
  223.             /* Selects one of the preferences system fonts:
  224.              *    0 - old DefaultFont, fixed-width
  225.              *    1 - WB Screen preferred font
  226.              */
  227. #define SA_Type        (SA_Dummy + 0x000D)
  228.             /* equiv. to NewScreen.Type            */
  229. #define SA_BitMap    (SA_Dummy + 0x000E)
  230.             /* ti_Data is pointer to custom BitMap.  This
  231.              * implies type of CUSTOMBITMAP
  232.              */
  233. #define SA_PubName    (SA_Dummy + 0x000F)
  234.             /* presence of this tag means that the screen
  235.              * is to be a public screen.  Please specify
  236.              * BEFORE the two tags below
  237.              */
  238. #define SA_PubSig    (SA_Dummy + 0x0010)
  239. #define SA_PubTask    (SA_Dummy + 0x0011)
  240.             /* Task ID and signal for being notified that
  241.              * the last window has closed on a public screen.
  242.              */
  243. #define SA_DisplayID    (SA_Dummy + 0x0012)
  244.             /* ti_Data is new extended display ID from
  245.              * <graphics/displayinfo.h>.
  246.              */
  247. #define SA_DClip    (SA_Dummy + 0x0013)
  248.             /* ti_Data points to a rectangle which defines
  249.              * screen display clip region
  250.              */
  251. #define SA_Overscan    (SA_Dummy + 0x0014)
  252.             /* was S_STDDCLIP.  Set to one of the OSCAN_
  253.              * specifiers below to get a system standard
  254.              * overscan region for your display clip,
  255.              * screen dimensions (unless otherwise specified),
  256.              * and automatically centered position (partial
  257.              * support only so far).
  258.              * If you use this, you shouldn't specify
  259.              * SA_DClip.  SA_Overscan is for "standard"
  260.              * overscan dimensions, SA_DClip is for
  261.              * your custom numeric specifications.
  262.              */
  263. #define SA_Obsolete1    (SA_Dummy + 0x0015)
  264.             /* obsolete S_MONITORNAME            */
  265.  
  266. /** booleans **/
  267. #define SA_ShowTitle    (SA_Dummy + 0x0016)
  268.             /* boolean equivalent to flag SHOWTITLE        */
  269. #define SA_Behind    (SA_Dummy + 0x0017)
  270.             /* boolean equivalent to flag SCREENBEHIND    */
  271. #define SA_Quiet    (SA_Dummy + 0x0018)
  272.             /* boolean equivalent to flag SCREENQUIET    */
  273. #define SA_AutoScroll    (SA_Dummy + 0x0019)
  274.             /* boolean equivalent to flag AUTOSCROLL    */
  275. #define SA_Pens        (SA_Dummy + 0x001A)
  276.             /* pointer to ~0 terminated UWORD array, as
  277.              * found in struct DrawInfo
  278.              */
  279. #define SA_FullPalette    (SA_Dummy + 0x001B)
  280.             /* boolean: initialize color table to entire
  281.              *  preferences palette (32 for V36), rather
  282.              * than compatible pens 0-3, 17-19, with
  283.              * remaining palette as returned by GetColorMap()
  284.              */
  285.  
  286. /* this is an obsolete tag included only for compatibility with V35
  287.  * interim release for the A2024 and Viking monitors
  288.  */
  289. #ifndef NSTAG_EXT_VPMODE
  290. #define NSTAG_EXT_VPMODE (TAG_USER | 1)
  291. #endif
  292.  
  293.  
  294. /* OpenScreen error codes, which are returned in the (optional) LONG
  295.  * pointed to by ti_Data for the SA_ErrorCode tag item
  296.  */
  297. #define OSERR_NOMONITOR    (1)    /* named monitor spec not available    */
  298. #define OSERR_NOCHIPS    (2)    /* you need newer custom chips        */
  299. #define OSERR_NOMEM    (3)    /* couldn't get normal memory        */
  300. #define OSERR_NOCHIPMEM    (4)    /* couldn't get chipmem            */
  301. #define OSERR_PUBNOTUNIQUE (5)    /* public screen name already used    */
  302. #define OSERR_UNKNOWNMODE (6)    /* don't recognize mode asked for    */
  303.  
  304. /* ======================================================================== */
  305. /* === NewScreen ========================================================== */
  306. /* ======================================================================== */
  307. /* note: to use the Extended field, you must use the
  308.  * new ExtNewScreen structure, below
  309.  */
  310. struct NewScreen
  311. {
  312.     WORD LeftEdge, TopEdge, Width, Height, Depth;  /* screen dimensions */
  313.  
  314.     UBYTE DetailPen, BlockPen;    /* for bar/border/gadget rendering    */
  315.  
  316.     UWORD ViewModes;        /* the Modes for the ViewPort (and View) */
  317.  
  318.     UWORD Type;            /* the Screen type (see defines above)    */
  319.  
  320.     struct TextAttr *Font;    /* this Screen's default text attributes */
  321.  
  322.     UBYTE *DefaultTitle;    /* the default title for this Screen    */
  323.  
  324.     struct Gadget *Gadgets;    /* UNUSED:  Leave this NULL        */
  325.  
  326.     /* if you are opening a CUSTOMSCREEN and already have a BitMap
  327.      * that you want used for your Screen, you set the flags CUSTOMBITMAP in
  328.      * the Type field and you set this variable to point to your BitMap
  329.      * structure.  The structure will be copied into your Screen structure,
  330.      * after which you may discard your own BitMap if you want
  331.      */
  332.     struct BitMap *CustomBitMap;
  333. };
  334.  
  335. /*
  336.  * For compatibility reasons, we need a new structure for extending
  337.  * NewScreen.  Use this structure is you need to use the new Extension
  338.  * field.
  339.  *
  340.  * NOTE: V36-specific applications should use the
  341.  * OpenScreenTagList( newscreen, tags ) version of OpenScreen().
  342.  * Applications that want to be V34-compatible as well may safely use the
  343.  * ExtNewScreen structure.  Its tags will be ignored by V34 Intuition.
  344.  *
  345.  */
  346. struct ExtNewScreen
  347. {
  348.     WORD LeftEdge, TopEdge, Width, Height, Depth;
  349.     UBYTE DetailPen, BlockPen;
  350.     UWORD ViewModes;
  351.     UWORD Type;
  352.     struct TextAttr *Font;
  353.     UBYTE *DefaultTitle;
  354.     struct Gadget *Gadgets;
  355.     struct BitMap *CustomBitMap;
  356.  
  357.     struct TagItem    *Extension;
  358.                 /* more specification data, scanned if
  359.                  * NS_EXTENDED is set in NewScreen.Type
  360.                  */
  361. };
  362.  
  363. /* === Overscan Types ===    */
  364. #define OSCAN_TEXT    (1)    /* entirely visible    */
  365. #define OSCAN_STANDARD    (2)    /* just past edges    */
  366. #define OSCAN_MAX    (3)    /* as much as possible    */
  367. #define OSCAN_VIDEO    (4)    /* even more than is possible    */
  368.  
  369.  
  370. /* === Public Shared Screen Node ===    */
  371.  
  372. /* This is the representative of a public shared screen.
  373.  * This is an internal data structure, but some functions may
  374.  * present a copy of it to the calling application.  In that case,
  375.  * be aware that the screen pointer of the structure can NOT be
  376.  * used safely, since there is no guarantee that the referenced
  377.  * screen will remain open and a valid data structure.
  378.  *
  379.  * Never change one of these.
  380.  */
  381.  
  382. struct PubScreenNode    {
  383.     struct Node        psn_Node;    /* ln_Name is screen name */
  384.     struct Screen    *psn_Screen;
  385.     UWORD        psn_Flags;    /* below        */
  386.     WORD        psn_Size;    /* includes name buffer    */
  387.     WORD        psn_VisitorCount; /* how many visitor windows */
  388.     struct Task        *psn_SigTask;    /* who to signal when visitors gone */
  389.     UBYTE        psn_SigBit;    /* which signal    */
  390. };
  391.  
  392. #define PSNF_PRIVATE    (0x0001)
  393.  
  394. #define MAXPUBSCREENNAME    (139)    /* names no longer, please    */
  395.  
  396. /* pub screen modes    */
  397. #define SHANGHAI    0x0001    /* put workbench windows on pub screen */
  398. #define POPPUBSCREEN    0x0002    /* pop pub screen to front when visitor opens */
  399.  
  400.  
  401. /* Include obsolete identifiers: */
  402. #ifndef INTUITION_IOBSOLETE_H
  403. #include <intuition/iobsolete.h>
  404. #endif
  405.  
  406. #endif
  407.